Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
React Dropzone accept="image/jpeg" is blocking other related function when it executes

I am using Dropzone from react-dropzone and want to upload only JPED files. When I use accept="image/jpeg" on file opening dialog only JPEG files appearing but it is blocking other relating function incide onDrop If user uploads other format files like png, pdf it should alert error message:

const ALLOWED_FORMAT = 'image/jpeg'
       if (!ALLOWED_FORMAT.includes(acceptedFiles[i].type)) {
          alert("Onlu JPEG files accepted")

          break;
        }

if I remove accept="image/jpeg" from Dropzone this function works as expected but I need to run both. If user uploads other formats this alter function should execute and alert error message! Where should I change or what should I add/remove?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!